package com.study.demoservice.bean.dto;

import com.study.demoservice.aop.PhoneNumber;
import com.study.demoservice.aop.Region;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * @author chenyeqing
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class PersonRequest {

    @NotNull(message = "classId 不能为空")
    private String classId;

    @Size(max = 33)
    @NotNull(message = "name 不能为空")
    private String name;

    @Pattern(regexp = "(^Man$|^Woman$|^UGM$)", message = "sex 值不在可选范围内")
    @NotNull(message = "sex 不能为空")
    private String sex;

    @com.study.demoservice.aop.Region
    private String region;

    @PhoneNumber(message = "手机号码不正确")
    private String phone;
    
}
